]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
js: Use global.focus_manager, rather than grabbing it ourselves
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 15 Aug 2012 16:22:01 +0000 (12:22 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 20 Aug 2012 01:15:48 +0000 (21:15 -0400)
js/ui/ctrlAltTab.js
js/ui/messageTray.js
js/ui/panelMenu.js

index 193f14ed99233aecdf43c94ae0a507dfb2ca0d4b..3462eac2362a255edabdb211ac018d42845e6575 100644 (file)
@@ -27,7 +27,6 @@ const CtrlAltTabManager = new Lang.Class({
 
     _init: function() {
         this._items = [];
-        this._focusManager = St.FocusManager.get_for_stage(global.stage);
     },
 
     addGroup: function(root, name, icon, params) {
@@ -41,11 +40,11 @@ const CtrlAltTabManager = new Lang.Class({
 
         this._items.push(item);
         root.connect('destroy', Lang.bind(this, function() { this.removeGroup(root); }));
-        this._focusManager.add_group(root);
+        global.focus_manager.add_group(root);
     },
 
     removeGroup: function(root) {
-        this._focusManager.remove_group(root);
+        global.focus_manager.remove_group(root);
         for (let i = 0; i < this._items.length; i++) {
             if (this._items[i].root == root) {
                 this._items.splice(i, 1);
index 4fcb271e7375d64c4464ff42fbf9a95ec66dce2a..986214a4d658b6ec0efa09c7261bc46796128f0e 100644 (file)
@@ -314,8 +314,6 @@ const Notification = new Lang.Class({
         this._table.connect('style-changed', Lang.bind(this, this._styleChanged));
         this.actor.set_child(this._table);
 
-        this._buttonFocusManager = St.FocusManager.get_for_stage(global.stage);
-
         // The first line should have the title, followed by the
         // banner text, but ellipsized if they won't both fit. We can't
         // make St.Table or St.BoxLayout do this the way we want (don't
@@ -638,10 +636,10 @@ const Notification = new Lang.Class({
         }
 
         if (this._buttonBox.get_n_children() > 0)
-            this._buttonFocusManager.remove_group(this._buttonBox);
+            global.focus_manager.remove_group(this._buttonBox);
 
         this._buttonBox.add(button);
-        this._buttonFocusManager.add_group(this._buttonBox);
+        global.focus_manager.add_group(this._buttonBox);
         button.connect('clicked', Lang.bind(this, this._onActionInvoked, id));
 
         this.updated();
@@ -1211,8 +1209,7 @@ const SummaryItem = new Lang.Class({
             this.rightClickMenu.add(item.actor);
        }
 
-        let focusManager = St.FocusManager.get_for_stage(global.stage);
-        focusManager.add_group(this.rightClickMenu);
+        global.focus_manager.add_group(this.rightClickMenu);
     },
 
     prepareNotificationStackForShowing: function() {
index f1800694b85391c5833a6951e2d8b0aae2caa628..542bb72e689f5502ddb4b05d5d4b984f7b25515d 100644 (file)
@@ -182,8 +182,7 @@ const Button = new Lang.Class({
     _onMenuKeyPress: function(actor, event) {
         let symbol = event.get_key_symbol();
         if (symbol == Clutter.KEY_Left || symbol == Clutter.KEY_Right) {
-            let focusManager = St.FocusManager.get_for_stage(global.stage);
-            let group = focusManager.get_group(this.actor);
+            let group = global.focus_manager.get_group(this.actor);
             if (group) {
                 let direction = (symbol == Clutter.KEY_Left) ? Gtk.DirectionType.LEFT : Gtk.DirectionType.RIGHT;
                 group.navigate_focus(this.actor, direction, false);